<?xml version="1.0" encoding="UTF-8"?>
<!--  PL_005f versao alteracao do xServ para tornar CANCELAR obrigatorio 28/06/2010 -->
<xs:schema xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns="http://www.portalfiscal.inf.br/nfe" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.portalfiscal.inf.br/nfe" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema_v1.01.xsd"/>
	<xs:include schemaLocation="tiposBasico_v1.02.xsd"/>
	<xs:complexType name="TCancNFe">
		<xs:annotation>
			<xs:documentation>Tipo Pedido de Cancelamento de NF-e</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="infCanc">
				<xs:annotation>
					<xs:documentation>Dados do Pedido de Cancelamento da Nota Fiscal Eletrônica</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:sequence>
						<xs:element name="tpAmb" type="TAmb">
							<xs:annotation>
								<xs:documentation>Identificação do Ambiente:
1 - Produção
2 - Homologação</xs:documentation>
							</xs:annotation>
						</xs:element>
						<xs:element name="xServ">
							<xs:annotation>
								<xs:documentation>Serviço Solicitado</xs:documentation>
							</xs:annotation>
							<xs:simpleType>
								<xs:restriction base="TServ">
									<xs:enumeration value="CANCELAR"/>
								</xs:restriction>
							</xs:simpleType>
						</xs:element>
						<xs:element name="chNFe" type="TChNFe">
							<xs:annotation>
								<xs:documentation>Chaves de acesso compostas por Código da UF + AAMM da emissão + CNPJ do Emitente + Modelo, Série e Número da NF-e + Código Numérico + DV.</xs:documentation>
							</xs:annotation>
						</xs:element>
						<xs:element name="nProt" type="TProt">
							<xs:annotation>
								<xs:documentation>Número do Protocolo de Status da NF-e. 1 posição (1 – Secretaria de Fazenda Estadual 2 – Receita Federal); 2 posições ano; 10 seqüencial no ano.</xs:documentation>
							</xs:annotation>
						</xs:element>
						<xs:element name="xJust" type="TJust">
							<xs:annotation>
								<xs:documentation>Justificativa do cancelamento</xs:documentation>
							</xs:annotation>
						</xs:element>
					</xs:sequence>
					<xs:attribute name="Id" use="required">
						<xs:simpleType>
							<xs:restriction base="xs:ID"/>
						</xs:simpleType>
					</xs:attribute>
				</xs:complexType>
			</xs:element>
			<xs:element ref="ds:Signature"/>
		</xs:sequence>
		<xs:attribute name="versao" type="TVerCancNFe" use="required"/>
	</xs:complexType>
	<xs:complexType name="TRetCancNFe">
		<xs:annotation>
			<xs:documentation>Tipo retorno Pedido de Cancelamento da Nota Fiscal Eletrônica</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="infCanc">
				<xs:annotation>
					<xs:documentation>Dados do Resultado do Pedido de Cancelamento da Nota Fiscal Eletrônica</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:sequence>
						<xs:element name="tpAmb" type="TAmb">
							<xs:annotation>
								<xs:documentation>Identificação do Ambiente:
1 - Produção
2 - Homologação</xs:documentation>
							</xs:annotation>
						</xs:element>
						<xs:element name="verAplic" type="TVerAplic">
							<xs:annotation>
								<xs:documentation>Versão do Aplicativo que processou o pedido de cancelamento</xs:documentation>
							</xs:annotation>
						</xs:element>
						<xs:element name="cStat" type="TStat">
							<xs:annotation>
								<xs:documentation>Código do status da mensagem enviada.</xs:documentation>
							</xs:annotation>
						</xs:element>
						<xs:element name="xMotivo" type="TMotivo">
							<xs:annotation>
								<xs:documentation>Descrição literal do status do serviço solicitado.</xs:documentation>
							</xs:annotation>
						</xs:element>
						<xs:element name="cUF" type="TCodUfIBGE">
							<xs:annotation>
								<xs:documentation>código da UF de atendimento</xs:documentation>
							</xs:annotation>
						</xs:element>
						<xs:element name="chNFe" type="TChNFe" minOccurs="0">
							<xs:annotation>
								<xs:documentation>Chaves de acesso da NF-e, compostas por: UF do emitente, AAMM da emissão da NFe, CNPJ do emitente, modelo, série e número da NF-e e código numérico + DV.</xs:documentation>
							</xs:annotation>
						</xs:element>
						<xs:element name="dhRecbto" type="xs:dateTime" minOccurs="0">
							<xs:annotation>
								<xs:documentation>Data e hora de recebimento, no formato AAAA-MM-DDTHH:MM:SS. Deve ser preenchida com data e hora da gravação no Banco em caso de Confirmação.</xs:documentation>
							</xs:annotation>
						</xs:element>
						<xs:element name="nProt" type="TProt" minOccurs="0">
							<xs:annotation>
								<xs:documentation>Número do Protocolo de Status da NF-e. 1 posição (1 – Secretaria de Fazenda Estadual 2 – Receita Federal); 2 - código da UF - 2 posições ano; 10 seqüencial no ano.</xs:documentation>
							</xs:annotation>
						</xs:element>
					</xs:sequence>
					<xs:attribute name="Id" type="xs:ID" use="optional"/>
				</xs:complexType>
			</xs:element>
			<xs:element ref="ds:Signature" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute name="versao" type="TVerCancNFe" use="required"/>
	</xs:complexType>
	<xs:complexType name="TProcCancNFe">
		<xs:annotation>
			<xs:documentation>Tipo Pedido de Cancelamento de  NF-e processado</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="cancNFe" type="TCancNFe"/>
			<xs:element name="retCancNFe" type="TRetCancNFe"/>
		</xs:sequence>
		<xs:attribute name="versao" type="TVerCancNFe" use="required"/>
	</xs:complexType>
	<xs:simpleType name="TVerCancNFe">
		<xs:annotation>
			<xs:documentation>Tipo Versão do leiaute de Cancelamento de NF-e -1.07</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:token">
			<xs:pattern value="1\.07"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>
